//
//  ZZInFactoryCell.m
//  新项目
//
//  Created by liGordon on 17/3/23.
//  Copyright © 2017年 刘耀宗. All rights reserved.
//

#import "ZZInFactoryCell.h"
#import "ZZInFactoryContentModel.h"
@interface ZZInFactoryCell()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@property (weak, nonatomic) IBOutlet UILabel *NewPhoneLabel;

@end
@implementation ZZInFactoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

+(instancetype)cellWithTableVIew:(UITableView *)tableView
{
    
    static NSString *identifier = @"InFactoryCell";
    ZZInFactoryCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:@"ZZInFactoryCell" owner:nil options:nil]firstObject];
    }
    return cell;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setModel:(ZZInFactoryContentModel *)model
{
    _model = model;
    self.titleLabel.text = model.CarOwner;
    self.nameLabel.text = model.PlateNumber;
    self.priceLabel.text = [NSString stringWithFormat:@"¥%@",model.Price];
    if (model.Type.length <= 0) {
        self.phoneLabel.text = @"暂无维修类型";
    }else{
        self.phoneLabel.text = model.Type;
    }
    NSString *timeStrT =  [model.RepairsTime substringToIndex:16];
    NSString *timeStr = [timeStrT stringByReplacingOccurrencesOfString:@"T" withString:@" "];
    self.timeLabel.text = timeStr;
    self.NewPhoneLabel.text = model.CarOwnerTel;
    self.detailLabel.text = model.TypeName;
    [self.phoneLabel setHidden:YES];
}
@end
